package com.liujit.upms.domain.params;

import com.liujit.common.domain.params.BaseParams;
import com.liujit.validator.constraints.Account;
import com.liujit.validator.constraints.Mobile;
import com.liujit.validator.group.AddGroup;
import com.liujit.validator.group.ModifyGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Description 系统用户请求参数
 * @Author liujun
 * @Date 2021-07-02 15:01:25
 */
@Data
@ApiModel(value = "SysUserParams", description = "系统用户请求参数")
public class SysUserParams extends BaseParams {

    @ApiModelProperty(value = "主键")
    @NotNull(message = "主键不能为空", groups = ModifyGroup.class)
    private Long id;

    @ApiModelProperty(value = "账号")
    @NotNull(message = "账号不能为空", groups = AddGroup.class)
    @Account(groups = AddGroup.class)
    private String account;

    @ApiModelProperty(value = "密码")
    private String pwd;

    @ApiModelProperty(value = "姓名")
    @NotNull(message = "姓名不能为空")
    @Length(max = 20, message = "姓名最大长度20")
    private String name;

    @ApiModelProperty(value = "手机号")
    @NotNull(message = "手机号不能为空")
    @Mobile
    private String mobile;

    @ApiModelProperty(value = "邮箱")
    @Email
    private String email;

    @ApiModelProperty(value = "性别：0、未知。1、男。2、女。")
    @NotNull(message = "性别不能为空")
    private Short gender;

    @ApiModelProperty(value = "头像")
    private String avatar;

    @ApiModelProperty(value = "机构id")
    private Long orgId;

    @ApiModelProperty(value = "机构编号")
    private String orgCode;

    @ApiModelProperty(value = "启用：1、是。0、否。")
    private Short enabled;

    @ApiModelProperty(value = "角色id")
    @NotNull(message = "角色不能为空", groups = { AddGroup.class, ModifyGroup.class })
    private List<Long> roleIds;
}